package co.fitstart.entity.courseware;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.alibaba.fastjson.annotation.JSONField;
import com.demo2do.core.format.PersistentFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;


/**
 * 
 * @author mohanlan
 *
 */
@Entity
@Table(name = "fitness_tag")
@PersistentFormat
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class FitnessTag {
	
	@Id
    @GeneratedValue
    private Long id;
	
	/** 健身标签名称 */
	private String name;
	
	/** 图片 */
    private String cover;
	
	/** 健身标签描述信息 */
    @Type(type = "text")
    @JSONField(serialize = false)
	private String description;
	
	/** 健身标签创建时间 */
    private Date createTime;
    
    /** 健身标签更新时间 */
    private Date updateTime;
    
    @Column(name = "is_disabled")
    @JSONField(serialize = false)
    private boolean disabled;
	
    /**
     * The default constructor
     */
    public FitnessTag() {
	}
    
    /**
     * 
     * @return
     */
    public FitnessTag initialize(){
    	this.createTime=new Date();
    	this.updateTime=this.createTime;
    	return this;
    	
    }
    
    public FitnessTag edit(){
    	
    	this.updateTime=new Date();
    	return this;
    }
    
    public FitnessTag disable(){
    	
    	this.disabled=true;
    	return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the cover
     */
    public String getCover() {
        return cover;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @return the updateTime
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param cover the cover to set
     */
    public void setCover(String cover) {
        this.cover = cover;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @param updateTime the updateTime to set
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
